package com.qf.application.controller;


import com.qf.application.entity.BankcardInfo;
import com.qf.application.service.BankcardInfoService;
import com.qf.application.utils.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author l
 * @since 2024-07-06
 */
@RestController
@RequestMapping("/bankcard-info")
public class BankcardInfoController {

    @Autowired
    private BankcardInfoService bankcardInfoService;

    @PostMapping("/save")
    public Result insertBankInfo (@RequestBody BankcardInfo bankcardInfo){
        bankcardInfo.setCreateTime(new Date());
        boolean save = bankcardInfoService.save(bankcardInfo);
        return Result.success(save,"信息填入完成");
    }

    @PutMapping("/update")
    public Result updateByUserId(@RequestBody BankcardInfo bankcardInfo){
        Boolean b = bankcardInfoService.putByUserId(bankcardInfo);
        return Result.success(b);
    }

}
